#ifndef EPOLL_H
#define EPOLL_H

#pragma once
#include <vector>
#include <sys/epoll.h>
#include "Channel.h"

class Epoll
{
public:
    Epoll(int maxEvent = 1000);
    ~Epoll();
    // 返回待处理的事件
    std::vector<Channel* > Wait(int timeout = -1);
    void updateChannel(Channel* ch);
    void removeChannel(Channel* ch);
private:
    int maxEvent_ = 1000;
    epoll_event* events = nullptr;

    int epFd_ = -1;

};

#endif